<?php

class commentTable extends Doctrine_Table
{
	
	public static function getInstance()
	{
		return Doctrine_Core::getTable('comment');
	}
	
	function getCommentListByTopicId($topic_id)
	{
		return $this->createQuery()->leftJoin('comment.user u')
		  ->where('comment.post_id = ?', $topic_id)
		  ->orderBy("comment.id DESC")
		  ->execute(array (), Doctrine_Core::HYDRATE_RECORD);
	}
}